package com.yidu.BusinessData.mapper;


import com.yidu.BusinessData.entity.BondEntity;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
@Mapper
public interface BondMapper {
    //@Select("select * from Bond order by bondId limit #{page},#{limit}")
    @Select("select * from bond where bondName like '%' #{bondName} '%' order by bondId limit #{page},#{limit}")
    public List<BondEntity> bondSelect(Map map);
    @Select("select count(*) from Bond")
    public int bondSelectCount();
    @Insert("insert into bond values(#{bondId},#{bondName},#{bondstartDate},#{bondEndDate},#{bondType},#{bondMoney},#{bondLiXi},#{bondRate},#{ciShu},#{bondBeiZhu})")
    public void bongInsert(BondEntity bond);
    @Update("update bond set bondName=#{bondName},bondstartDate=#{bondstartDate},bondEndDate=#{bondEndDate},bondType=#{bondType},bondMoney=#{bondMoney},bondLiXi=#{bondLiXi},bondRate=#{bondRate},ciShu=#{ciShu},bondBeiZhu=#{bondBeiZhu} where bondId=#{bondId}")
    public void bondUpdate(BondEntity bond);
    @Delete("delete from bond where bondId=#{bondId}")
    public void bondDelete(String bondId);
    @Select("select * from bond where bondName like #{bondName}")
    public List<BondEntity> bondSelectName(String bondName);
    @Select("select * from bond where bondId=#{bondId}")
    public BondEntity selectBond(String bondId);
}
